<!--
 * @Description: 设置logo位置
 * @Author bianpengfei
 * @create 2021/4/21 15:28
 -->
<template>
  <div class="g-logo__wrap">
    <img v-if="logoShow" :src="_img" style="width: 28px; height: 28px" class="logo g-app__header-logo" />
    <div v-if="titleShow" class="g-logo-title g-app__header-title">{{ application.name }}</div>
  </div>
</template>

<script>
import { get } from 'vuex-pathify'
import defaultSetting from '@/setting'

export default {
  name: 'Index',
  props: {
    logoShow: {
      type: Boolean,
      default: true
    },
    titleShow: {
      type: Boolean,
      default: true
    }
  },

  data() {
    return {
      application: defaultSetting.application
    }
  },

  computed: {
    _theme: get('app/theme'),

    _img() {
      return ['white', 'black-and-white', 'mandala'].includes(this._theme)
        ? defaultSetting.logo.dark
        : defaultSetting.logo.light
    }
  }
}
</script>
